home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / disk / backuputils / stow07b.lha / ansi.h next >
Encoding:
C/C++ Source or Header  |  1993-10-24  |  1.3 KB  |  53 lines

  1. /*ansi.h*/
  2. /*This is something I used for another project that makes it more*/
  3. /*clear when reading ansi codes.*/
  4.  
  5. #define   PREAMBLE  "\033["
  6.  
  7. #define   CLEAR     "2J"
  8. #define   CLS       '\014'
  9. #define   NORMAL    '0'
  10. #define   BOLD      '1'
  11. #define   HIGHLIGHT '2'
  12. #define   ITALICS   '3'
  13. #define   UNDERLINE '4'
  14. #define   REVERSE   '7'
  15. #define   UP        'A'
  16. #define   DOWN      'B'
  17. #define   RIGHT     'C'
  18. #define   LEFT      'D'
  19. #define   POSITION  'H'
  20. #define   COLOR     'm'
  21.  
  22. #define   FGROUND   '3'
  23. #define   BGROUND   '4'
  24.  
  25. #define   BLACK     '0'
  26. #define   RED       '1'
  27. #define   GREEN     '2'
  28. #define   YELLOW    '3'
  29. #define   BLUE      '4'
  30. #define   PURPLE    '5'
  31. #define   CYAN      '6'
  32. #define   WHITE     '7'
  33.  
  34. #define ScreenCommand(COMMAND) printf("%s%c",PREAMBLE,COMMAND)
  35.  
  36. #define ChangeColors(FRONT,BACK) printf("%s%c%c;%c%c%c",PREAMBLE,FGROUND,FRONT,BGROUND,BACK,COLOR)
  37.  
  38. #define ChangeMode(TYPE) printf("%s%c%c",PREAMBLE,TYPE,COLOR)
  39.  
  40. #define MoveCursor(DISTANCE,DIRECTION) printf("%s%d%c",PREAMBLE,DISTANCE,DIRECTION)
  41.  
  42. #define PosCursor(DOWN,ACROSS) printf("%s%d;%d%c",PREAMBLE,DOWN,ACROSS,POSITION)
  43.  
  44. #define ClearScreen() printf("%s%s%c",PREAMBLE,CLEAR,CLS)
  45.  
  46.  
  47. #define   TOP_LEFT  '+'
  48. #define   TOP_RGHT  '+' 
  49. #define   BOT_LEFT  '+'
  50. #define   BOT_RGHT  '+'
  51. #define   VERT      '|'
  52. #define   HORZ      '-'
  53.